<?php
@header("Content-type:text/html;charset=GB2312");
defined('BASEPATH') OR exit('No direct script access allowed');

class Classify extends CI_Controller
{
    function index(){
        $my = $this->load->database('default', TRUE);
        $ms = $this->load->database('sqlserver', TRUE);

        $size = 500;
        $page = isset($_GET['page']) ? $_GET['page'] : 1;
        $zongshu = $page * $size;

        $sql = "select top $size * from (select top $zongshu  * from NC_Classify order by ClassID asc) NC_Classify order by ClassID desc";
        $msq = $ms->query($sql)->result_array();
        $m = array();
        foreach($msq as $v){
            $k = array(
                'ClassID'=> $v['ClassID'],
                'ChannelID'=> $v['ChannelID'],
                'rootid'=> $v['rootid'],
                'depth'=> $v['depth'],
                'ClassName'=> $v['ClassName'],
                'ColorModes'=> $v['ColorModes'],
                'FontModes'=> $v['FontModes'],
                'Readme'=> $v['Readme'],
                'orders'=> $v['orders'],
                'parentid'=> $v['parentid'],
                'ParentStr'=> $v['ParentStr'],
                'child'=> $v['child'],
                'ChildStr'=> $v['ChildStr'],
                'LinkTarget'=> $v['LinkTarget'],
                'TurnLink'=> $v['TurnLink'],
                'TurnLinkUrl'=> $v['TurnLinkUrl'],
                'UserGroup'=> $v['UserGroup'],
                'ClassDir'=> $v['ClassDir'],
                'HtmlFileDir'=> $v['HtmlFileDir'],
                'UseHtml'=> $v['UseHtml'],
                'skinid'=> $v['skinid'],
                'ShowCount'=> $v['ShowCount'],
                'isUpdate'=> $v['isUpdate'],
                'AdsCode'=> $v['AdsCode'],
                'stopad'=> $v['stopad'],
                'phoneimg'=> $v['phoneimg'],
            );
            $m[] = $k;
        }
        var_dump("<pre>");
        var_dump($m);
    }
}